// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement;

public sealed partial class Actions
{
	/// <summary>
	/// <para>
	/// Phases allowed: warm, cold.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("allocate")]
	public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateAction? Allocate { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: delete.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("delete")]
	public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteAction? Delete { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm, cold.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("downsample")]
	public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleAction? Downsample { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("forcemerge")]
	public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeAction? Forcemerge { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: warm, cold.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("migrate")]
	public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateAction? Migrate { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm, cold.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("readonly")]
	public Elastic.Clients.Elasticsearch.EmptyObject? Readonly { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: hot.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("rollover")]
	public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverAction? Rollover { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: hot, cold, frozen.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("searchable_snapshot")]
	public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotAction? SearchableSnapshot { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm, cold.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("set_priority")]
	public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityAction? SetPriority { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("shrink")]
	public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkAction? Shrink { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm, cold, frozen.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("unfollow")]
	public Elastic.Clients.Elasticsearch.EmptyObject? Unfollow { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: delete.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("wait_for_snapshot")]
	public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotAction? WaitForSnapshot { get; set; }
}

public sealed partial class ActionsDescriptor : SerializableDescriptor<ActionsDescriptor>
{
	internal ActionsDescriptor(Action<ActionsDescriptor> configure) => configure.Invoke(this);

	public ActionsDescriptor() : base()
	{
	}

	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateAction? AllocateValue { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateActionDescriptor AllocateDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateActionDescriptor> AllocateDescriptorAction { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteAction? DeleteValue { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteActionDescriptor DeleteDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteActionDescriptor> DeleteDescriptorAction { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleAction? DownsampleValue { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleActionDescriptor DownsampleDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleActionDescriptor> DownsampleDescriptorAction { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeAction? ForcemergeValue { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeActionDescriptor ForcemergeDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeActionDescriptor> ForcemergeDescriptorAction { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateAction? MigrateValue { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateActionDescriptor MigrateDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateActionDescriptor> MigrateDescriptorAction { get; set; }
	private Elastic.Clients.Elasticsearch.EmptyObject? ReadonlyValue { get; set; }
	private Elastic.Clients.Elasticsearch.EmptyObjectDescriptor ReadonlyDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.EmptyObjectDescriptor> ReadonlyDescriptorAction { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverAction? RolloverValue { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverActionDescriptor RolloverDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverActionDescriptor> RolloverDescriptorAction { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotAction? SearchableSnapshotValue { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotActionDescriptor SearchableSnapshotDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotActionDescriptor> SearchableSnapshotDescriptorAction { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityAction? SetPriorityValue { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityActionDescriptor SetPriorityDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityActionDescriptor> SetPriorityDescriptorAction { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkAction? ShrinkValue { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkActionDescriptor ShrinkDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkActionDescriptor> ShrinkDescriptorAction { get; set; }
	private Elastic.Clients.Elasticsearch.EmptyObject? UnfollowValue { get; set; }
	private Elastic.Clients.Elasticsearch.EmptyObjectDescriptor UnfollowDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.EmptyObjectDescriptor> UnfollowDescriptorAction { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotAction? WaitForSnapshotValue { get; set; }
	private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotActionDescriptor WaitForSnapshotDescriptor { get; set; }
	private Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotActionDescriptor> WaitForSnapshotDescriptorAction { get; set; }

	/// <summary>
	/// <para>
	/// Phases allowed: warm, cold.
	/// </para>
	/// </summary>
	public ActionsDescriptor Allocate(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateAction? allocate)
	{
		AllocateDescriptor = null;
		AllocateDescriptorAction = null;
		AllocateValue = allocate;
		return Self;
	}

	public ActionsDescriptor Allocate(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateActionDescriptor descriptor)
	{
		AllocateValue = null;
		AllocateDescriptorAction = null;
		AllocateDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor Allocate(Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateActionDescriptor> configure)
	{
		AllocateValue = null;
		AllocateDescriptor = null;
		AllocateDescriptorAction = configure;
		return Self;
	}

	/// <summary>
	/// <para>
	/// Phases allowed: delete.
	/// </para>
	/// </summary>
	public ActionsDescriptor Delete(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteAction? delete)
	{
		DeleteDescriptor = null;
		DeleteDescriptorAction = null;
		DeleteValue = delete;
		return Self;
	}

	public ActionsDescriptor Delete(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteActionDescriptor descriptor)
	{
		DeleteValue = null;
		DeleteDescriptorAction = null;
		DeleteDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor Delete(Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteActionDescriptor> configure)
	{
		DeleteValue = null;
		DeleteDescriptor = null;
		DeleteDescriptorAction = configure;
		return Self;
	}

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm, cold.
	/// </para>
	/// </summary>
	public ActionsDescriptor Downsample(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleAction? downsample)
	{
		DownsampleDescriptor = null;
		DownsampleDescriptorAction = null;
		DownsampleValue = downsample;
		return Self;
	}

	public ActionsDescriptor Downsample(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleActionDescriptor descriptor)
	{
		DownsampleValue = null;
		DownsampleDescriptorAction = null;
		DownsampleDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor Downsample(Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleActionDescriptor> configure)
	{
		DownsampleValue = null;
		DownsampleDescriptor = null;
		DownsampleDescriptorAction = configure;
		return Self;
	}

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm.
	/// </para>
	/// </summary>
	public ActionsDescriptor Forcemerge(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeAction? forcemerge)
	{
		ForcemergeDescriptor = null;
		ForcemergeDescriptorAction = null;
		ForcemergeValue = forcemerge;
		return Self;
	}

	public ActionsDescriptor Forcemerge(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeActionDescriptor descriptor)
	{
		ForcemergeValue = null;
		ForcemergeDescriptorAction = null;
		ForcemergeDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor Forcemerge(Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeActionDescriptor> configure)
	{
		ForcemergeValue = null;
		ForcemergeDescriptor = null;
		ForcemergeDescriptorAction = configure;
		return Self;
	}

	/// <summary>
	/// <para>
	/// Phases allowed: warm, cold.
	/// </para>
	/// </summary>
	public ActionsDescriptor Migrate(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateAction? migrate)
	{
		MigrateDescriptor = null;
		MigrateDescriptorAction = null;
		MigrateValue = migrate;
		return Self;
	}

	public ActionsDescriptor Migrate(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateActionDescriptor descriptor)
	{
		MigrateValue = null;
		MigrateDescriptorAction = null;
		MigrateDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor Migrate(Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateActionDescriptor> configure)
	{
		MigrateValue = null;
		MigrateDescriptor = null;
		MigrateDescriptorAction = configure;
		return Self;
	}

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm, cold.
	/// </para>
	/// </summary>
	public ActionsDescriptor Readonly(Elastic.Clients.Elasticsearch.EmptyObject? value)
	{
		ReadonlyDescriptor = null;
		ReadonlyDescriptorAction = null;
		ReadonlyValue = value;
		return Self;
	}

	public ActionsDescriptor Readonly(Elastic.Clients.Elasticsearch.EmptyObjectDescriptor descriptor)
	{
		ReadonlyValue = null;
		ReadonlyDescriptorAction = null;
		ReadonlyDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor Readonly(Action<Elastic.Clients.Elasticsearch.EmptyObjectDescriptor> configure)
	{
		ReadonlyValue = null;
		ReadonlyDescriptor = null;
		ReadonlyDescriptorAction = configure;
		return Self;
	}

	/// <summary>
	/// <para>
	/// Phases allowed: hot.
	/// </para>
	/// </summary>
	public ActionsDescriptor Rollover(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverAction? rollover)
	{
		RolloverDescriptor = null;
		RolloverDescriptorAction = null;
		RolloverValue = rollover;
		return Self;
	}

	public ActionsDescriptor Rollover(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverActionDescriptor descriptor)
	{
		RolloverValue = null;
		RolloverDescriptorAction = null;
		RolloverDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor Rollover(Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverActionDescriptor> configure)
	{
		RolloverValue = null;
		RolloverDescriptor = null;
		RolloverDescriptorAction = configure;
		return Self;
	}

	/// <summary>
	/// <para>
	/// Phases allowed: hot, cold, frozen.
	/// </para>
	/// </summary>
	public ActionsDescriptor SearchableSnapshot(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotAction? searchableSnapshot)
	{
		SearchableSnapshotDescriptor = null;
		SearchableSnapshotDescriptorAction = null;
		SearchableSnapshotValue = searchableSnapshot;
		return Self;
	}

	public ActionsDescriptor SearchableSnapshot(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotActionDescriptor descriptor)
	{
		SearchableSnapshotValue = null;
		SearchableSnapshotDescriptorAction = null;
		SearchableSnapshotDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor SearchableSnapshot(Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotActionDescriptor> configure)
	{
		SearchableSnapshotValue = null;
		SearchableSnapshotDescriptor = null;
		SearchableSnapshotDescriptorAction = configure;
		return Self;
	}

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm, cold.
	/// </para>
	/// </summary>
	public ActionsDescriptor SetPriority(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityAction? setPriority)
	{
		SetPriorityDescriptor = null;
		SetPriorityDescriptorAction = null;
		SetPriorityValue = setPriority;
		return Self;
	}

	public ActionsDescriptor SetPriority(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityActionDescriptor descriptor)
	{
		SetPriorityValue = null;
		SetPriorityDescriptorAction = null;
		SetPriorityDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor SetPriority(Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityActionDescriptor> configure)
	{
		SetPriorityValue = null;
		SetPriorityDescriptor = null;
		SetPriorityDescriptorAction = configure;
		return Self;
	}

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm.
	/// </para>
	/// </summary>
	public ActionsDescriptor Shrink(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkAction? shrink)
	{
		ShrinkDescriptor = null;
		ShrinkDescriptorAction = null;
		ShrinkValue = shrink;
		return Self;
	}

	public ActionsDescriptor Shrink(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkActionDescriptor descriptor)
	{
		ShrinkValue = null;
		ShrinkDescriptorAction = null;
		ShrinkDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor Shrink(Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkActionDescriptor> configure)
	{
		ShrinkValue = null;
		ShrinkDescriptor = null;
		ShrinkDescriptorAction = configure;
		return Self;
	}

	/// <summary>
	/// <para>
	/// Phases allowed: hot, warm, cold, frozen.
	/// </para>
	/// </summary>
	public ActionsDescriptor Unfollow(Elastic.Clients.Elasticsearch.EmptyObject? unfollow)
	{
		UnfollowDescriptor = null;
		UnfollowDescriptorAction = null;
		UnfollowValue = unfollow;
		return Self;
	}

	public ActionsDescriptor Unfollow(Elastic.Clients.Elasticsearch.EmptyObjectDescriptor descriptor)
	{
		UnfollowValue = null;
		UnfollowDescriptorAction = null;
		UnfollowDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor Unfollow(Action<Elastic.Clients.Elasticsearch.EmptyObjectDescriptor> configure)
	{
		UnfollowValue = null;
		UnfollowDescriptor = null;
		UnfollowDescriptorAction = configure;
		return Self;
	}

	/// <summary>
	/// <para>
	/// Phases allowed: delete.
	/// </para>
	/// </summary>
	public ActionsDescriptor WaitForSnapshot(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotAction? waitForSnapshot)
	{
		WaitForSnapshotDescriptor = null;
		WaitForSnapshotDescriptorAction = null;
		WaitForSnapshotValue = waitForSnapshot;
		return Self;
	}

	public ActionsDescriptor WaitForSnapshot(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotActionDescriptor descriptor)
	{
		WaitForSnapshotValue = null;
		WaitForSnapshotDescriptorAction = null;
		WaitForSnapshotDescriptor = descriptor;
		return Self;
	}

	public ActionsDescriptor WaitForSnapshot(Action<Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotActionDescriptor> configure)
	{
		WaitForSnapshotValue = null;
		WaitForSnapshotDescriptor = null;
		WaitForSnapshotDescriptorAction = configure;
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
		writer.WriteStartObject();
		if (AllocateDescriptor is not null)
		{
			writer.WritePropertyName("allocate");
			JsonSerializer.Serialize(writer, AllocateDescriptor, options);
		}
		else if (AllocateDescriptorAction is not null)
		{
			writer.WritePropertyName("allocate");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateActionDescriptor(AllocateDescriptorAction), options);
		}
		else if (AllocateValue is not null)
		{
			writer.WritePropertyName("allocate");
			JsonSerializer.Serialize(writer, AllocateValue, options);
		}

		if (DeleteDescriptor is not null)
		{
			writer.WritePropertyName("delete");
			JsonSerializer.Serialize(writer, DeleteDescriptor, options);
		}
		else if (DeleteDescriptorAction is not null)
		{
			writer.WritePropertyName("delete");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteActionDescriptor(DeleteDescriptorAction), options);
		}
		else if (DeleteValue is not null)
		{
			writer.WritePropertyName("delete");
			JsonSerializer.Serialize(writer, DeleteValue, options);
		}

		if (DownsampleDescriptor is not null)
		{
			writer.WritePropertyName("downsample");
			JsonSerializer.Serialize(writer, DownsampleDescriptor, options);
		}
		else if (DownsampleDescriptorAction is not null)
		{
			writer.WritePropertyName("downsample");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleActionDescriptor(DownsampleDescriptorAction), options);
		}
		else if (DownsampleValue is not null)
		{
			writer.WritePropertyName("downsample");
			JsonSerializer.Serialize(writer, DownsampleValue, options);
		}

		if (ForcemergeDescriptor is not null)
		{
			writer.WritePropertyName("forcemerge");
			JsonSerializer.Serialize(writer, ForcemergeDescriptor, options);
		}
		else if (ForcemergeDescriptorAction is not null)
		{
			writer.WritePropertyName("forcemerge");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeActionDescriptor(ForcemergeDescriptorAction), options);
		}
		else if (ForcemergeValue is not null)
		{
			writer.WritePropertyName("forcemerge");
			JsonSerializer.Serialize(writer, ForcemergeValue, options);
		}

		if (MigrateDescriptor is not null)
		{
			writer.WritePropertyName("migrate");
			JsonSerializer.Serialize(writer, MigrateDescriptor, options);
		}
		else if (MigrateDescriptorAction is not null)
		{
			writer.WritePropertyName("migrate");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateActionDescriptor(MigrateDescriptorAction), options);
		}
		else if (MigrateValue is not null)
		{
			writer.WritePropertyName("migrate");
			JsonSerializer.Serialize(writer, MigrateValue, options);
		}

		if (ReadonlyDescriptor is not null)
		{
			writer.WritePropertyName("readonly");
			JsonSerializer.Serialize(writer, ReadonlyDescriptor, options);
		}
		else if (ReadonlyDescriptorAction is not null)
		{
			writer.WritePropertyName("readonly");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.EmptyObjectDescriptor(ReadonlyDescriptorAction), options);
		}
		else if (ReadonlyValue is not null)
		{
			writer.WritePropertyName("readonly");
			JsonSerializer.Serialize(writer, ReadonlyValue, options);
		}

		if (RolloverDescriptor is not null)
		{
			writer.WritePropertyName("rollover");
			JsonSerializer.Serialize(writer, RolloverDescriptor, options);
		}
		else if (RolloverDescriptorAction is not null)
		{
			writer.WritePropertyName("rollover");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverActionDescriptor(RolloverDescriptorAction), options);
		}
		else if (RolloverValue is not null)
		{
			writer.WritePropertyName("rollover");
			JsonSerializer.Serialize(writer, RolloverValue, options);
		}

		if (SearchableSnapshotDescriptor is not null)
		{
			writer.WritePropertyName("searchable_snapshot");
			JsonSerializer.Serialize(writer, SearchableSnapshotDescriptor, options);
		}
		else if (SearchableSnapshotDescriptorAction is not null)
		{
			writer.WritePropertyName("searchable_snapshot");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotActionDescriptor(SearchableSnapshotDescriptorAction), options);
		}
		else if (SearchableSnapshotValue is not null)
		{
			writer.WritePropertyName("searchable_snapshot");
			JsonSerializer.Serialize(writer, SearchableSnapshotValue, options);
		}

		if (SetPriorityDescriptor is not null)
		{
			writer.WritePropertyName("set_priority");
			JsonSerializer.Serialize(writer, SetPriorityDescriptor, options);
		}
		else if (SetPriorityDescriptorAction is not null)
		{
			writer.WritePropertyName("set_priority");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityActionDescriptor(SetPriorityDescriptorAction), options);
		}
		else if (SetPriorityValue is not null)
		{
			writer.WritePropertyName("set_priority");
			JsonSerializer.Serialize(writer, SetPriorityValue, options);
		}

		if (ShrinkDescriptor is not null)
		{
			writer.WritePropertyName("shrink");
			JsonSerializer.Serialize(writer, ShrinkDescriptor, options);
		}
		else if (ShrinkDescriptorAction is not null)
		{
			writer.WritePropertyName("shrink");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkActionDescriptor(ShrinkDescriptorAction), options);
		}
		else if (ShrinkValue is not null)
		{
			writer.WritePropertyName("shrink");
			JsonSerializer.Serialize(writer, ShrinkValue, options);
		}

		if (UnfollowDescriptor is not null)
		{
			writer.WritePropertyName("unfollow");
			JsonSerializer.Serialize(writer, UnfollowDescriptor, options);
		}
		else if (UnfollowDescriptorAction is not null)
		{
			writer.WritePropertyName("unfollow");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.EmptyObjectDescriptor(UnfollowDescriptorAction), options);
		}
		else if (UnfollowValue is not null)
		{
			writer.WritePropertyName("unfollow");
			JsonSerializer.Serialize(writer, UnfollowValue, options);
		}

		if (WaitForSnapshotDescriptor is not null)
		{
			writer.WritePropertyName("wait_for_snapshot");
			JsonSerializer.Serialize(writer, WaitForSnapshotDescriptor, options);
		}
		else if (WaitForSnapshotDescriptorAction is not null)
		{
			writer.WritePropertyName("wait_for_snapshot");
			JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotActionDescriptor(WaitForSnapshotDescriptorAction), options);
		}
		else if (WaitForSnapshotValue is not null)
		{
			writer.WritePropertyName("wait_for_snapshot");
			JsonSerializer.Serialize(writer, WaitForSnapshotValue, options);
		}

		writer.WriteEndObject();
	}
}